A Gray Code for Set Partitions
نویسنده
چکیده
We consider here the collection of all partitions of an n-set, for fixed n, and we ask: is it possible to arrange these partitions in a list (Gray Code) so that each partition is obtained from its immediate predecessor by changing the class of exactly one element? The answer is affirmative, and we give descriptions of two algorithms which implement the method, the first recursive, the second non-recursive. The question was raised by Nijenhuis and WiIf in [1]. The answer in recursive form was given first by Knuth [unpublished]. Our non-recursive algorithm has uniformly bounded average labor per partition as a function of n.
منابع مشابه
Loop-free Gray code algorithm for the e-restricted growth functions
The subject of Gray codes algorithms for the set partitions of {1, 2, . . . , n} had been covered in several works. The first Gray code for that set was introduced by Knuth [3], later, Ruskey presented a modified version of Knuth’s algorithm with distance two, Ehrlich [5] introduced a loop-free algorithm for the set of partitions of {1, 2, . . . , n}, Ruskey and Savage [16] generalized Ehrlich’...
متن کاملGray Codes, Loopless Algorithm and Partitions
The generation of efficient Gray codes and combinatorial algorithms that list all the members of a combinatorial object has received a lot of attention in the last few years. Knuth gave a code for the set of all partitions of [n] = {1, 2, . . . , n}. Ruskey presented a modified version of Knuth’s algorithm with distance 2. Ehrlich introduced a looplees algorithm for the set of the partitions of...
متن کاملGray codes for set partitions and restricted growth tails
We survey results on generating set partitions S n and restricted growth tails T n k with an emphasis on Gray code listings in which the change be tween successive elements is minimal Although there is a well known bijection between S n and T n it preserves minimal changes in only one direction We show that a minimal Gray code listing for T n k is not always possible although for a slight relax...
متن کاملGray Code Enumeration of Families of Integer Partitions
In this paper we show that the elements of certain families of integer partitions can be listed in a minimal change, or Gray code, order. In particular, we construct Gray code listings for the classes Pδ(n, k) and D(n, k) of partitions of n into parts of size at most k in which, for Pδ(n, k), the parts are congruent to one modulo δ and, for D(n, k), the parts are distinct. The change required b...
متن کاملm-compositions and m-partitions: exhaustive generation and Gray code
In this paper we give an exhaustive generation algorithm for the class of m-compositions of integers with fixed m. Moreover we define a Gray code to list these combinatorial objects according to a particular order. Finally, we define m-partitions, which are an m-dimensional generalization of integer partitions, and an exhaustive generation algorithm for m-partitions, based on the same ideas use...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Inf. Process. Lett.
دوره 5 شماره
صفحات -
تاریخ انتشار 1976